package edu.nuc.projdemo.sys.services.impl;

import java.util.List;

import edu.nuc.projdemo.common.PageControl;
import edu.nuc.projdemo.common.Pager;
import edu.nuc.projdemo.eto.News;
import edu.nuc.projdemo.model.Article;
import edu.nuc.projdemo.sys.dao.impl.ArticleDao;
import edu.nuc.projdemo.sys.dao.interfaces.IArticleDao;
import edu.nuc.projdemo.sys.services.interfaces.IArticleService;

public class ArticleService implements IArticleService {
	
	IArticleDao articleDao = new ArticleDao();

	public Integer saveArt(Article article) {
		
		return articleDao.saveArt(article);
	}

	public Pager<Article> listAll(Article article,PageControl pc) {
		
		return articleDao.listAll(article,pc);
	}

	public Article findArtByid(int aid,int nid) {
		
		return articleDao.findArtByid(aid,nid);
	}

	public int edit(Article article) {
		
		return articleDao.edit(article);
	}

	public int editArticle(int aid, String content) {
		
		return articleDao.editArticle(aid,content);
	}

	public Article findArtByid(int aid) {
		
		return articleDao.findArtByid(aid);
		
	}

	public void updateState(int aid, int state,String aduser) {
		
		articleDao.updateState(aid,state,aduser);
	}

	public int deleteArt(int aid) {
		
		return 	articleDao.deleteArt(aid);
	}

	public List<Article> listfocus() {
		
		return articleDao.listfocus();
	}

	public List<Article> viewarticle(int nid) {
		
		return articleDao.viewarticle(nid);
	}

	public void modifyPic(int aid,String pic) throws RuntimeException{
		
		articleDao.modifyPic(aid,pic);
	}

	public Pager<Article> listarticlepage(int nid,PageControl pc) {
		
		return articleDao.listarticlepage(nid,pc);
	}

	public Article openaticle(int aid) {
		
		return articleDao.openaticle(aid);
	}



	public List<News> listNews(int newid) {
	
		return articleDao.listNews(newid);
	}

}
